home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aac.d64
/
comal-misshd3.l
< prev
next >
Wrap
Text File
|
2007-02-28
|
4KB
|
149 lines
0010 //DELETE "0:MISSHD3-CO"
0020 //SAVE "0:MISSHD3-CO"
0030 //2D PROP NAV AIR-TO-GROUND MISSILE
0035 POKE 53265,11 // BLANK SCREEN
0040 SELECT OUTPUT "LP:"
0050 VA:=1562
0060 XT:=5000
0070 ANL:=4
0080 VT:=0
0090 GAMT:=0
0100 ATAU:=.05
0110 T3:=0
0120 PRINT
0130 PRINT " 2D AIR-TO GROUND MISSILE SOLUTION -LINEAR- VER 5/10/84"
0140 PRINT
0150 PRINT "VA=",VA," XT=",XT," VT=",VT," GAMT=",GAMT," ATAU=",ATAU," T3=",T3
0160 PRINT
0170 PRINT TAB(2),"T";TAB(6),"VM";TAB(12),"DELX";TAB(18),"DELZ";
0180 PRINT TAB(24),"SIGR";TAB(30),"GAMM";TAB(36),"THM";TAB(42),"AL";
0190 PRINT TAB(49),"GA";TAB(56),"DELS";TAB(63),"ANM";TAB(70),"ZD"
0200 DT:=.01
0210 GC:=32.1739
0220 RAD:=57.2958
0230 PIE:=3.1415927
0240 XM:=0
0250 XI:=XT
0260 ZM:=0
0270 ZT:=500
0280 SIGT:=ATN((ZM-ZT)/(XT-XM))
0290 SIGR:=0
0300 SIGRD:=0
0310 AKA:=-2.125
0320 AKR:=5
0330 AKT:=5
0340 AKN:=AKT*ANL
0350 GAMMD:=0
0360 GAMM:=0
0370 AL:=0
0380 W:=48.3
0390 S:=.196
0400 RHO:=2.3769E-03
0410 CBAR:=.5
0420 IY:=1.6
0430 CL:=0
0440 VS:=1116.9
0450 VM:=VA
0460 GAMT:=GAMT/RAD
0470 GAMTD:=0
0480 THDD:=0
0490 THD:=0
0500 THM:=0
0510 T:=0
0520 T2:=.1
0530 T4:=T3
0540 TR:=385
0550 BTAU:=ATAU+DT
0560 DELMAX:=.087
0570 DELS:=0
0580 DELTR:=-9.7E-03
0590 EP:=0
0600 E2P:=0
0610 SIGRD:=0
0620 //ITERATIVE CALCULATION
0630 //TRACKING LOOP
0640 REPEAT
0650 EP:=SIGT-SIGR
0660 IF T>(T4-DT) THEN SAMPLEDATA
0670 SIGR:=SIGR+SIGRD*DT
0680 D1EL:=E2P*AKR*(AKN/AKA)+DELTR
0690 DELS:=(DELS*ATAU+D1EL*DT)/BTAU
0700 IF DELS>DELMAX THEN DELS:=DELMAX
0710 IF DELS<-DELMAX THEN DELS:=-DELMAX
0720 //AERODYNAMICS AND CONTROL
0730 AM:=VM/VS
0740 CDO:=.669
0750 CDCL2:=.045
0760 CMA:=-3.85
0770 CMD:=-3.52
0780 CMQ:=-400
0790 CLAL:=13.6
0800 CLD:=3.15
0810 CL:=AL*CLAL+DELS*CLD
0820 CD:=CDO+CDCL2*CL*CL
0830 QA:=.5*RHO*VM*VM
0840 QS:=QA*S
0850 ZL:=QS*CL
0860 D:=QS*CD
0870 AMTHD:=QS*CBAR*CBAR*CMQ*THD/(2*VM)
0880 AMAL:=QS*CBAR*CMA*AL
0890 AMDEL:=QS*CBAR*CMD*DELS
0900 THDD:=(AMAL+AMDEL+AMTHD)/IY
0910 THD:=THD+THDD*DT
0920 THM:=THM+THD*DT
0930 GAMMD:=((ZL/W)+(TR/W)*SIN(AL)-COS(GAMM))*GC/VM
0940 GAMM:=GAMM+GAMMD*DT
0950 VMD:=GC*((TR/W)*COS(AL)-D/W-SIN(GAMM))
0960 ANM:=VM*GAMMD/GC
0970 VM:=VM+VMD*DT
0980 AL:=THM-GAMM
0990 GA:=SIGR-THM
1000 IF GA>=.35 THEN GA:=.35
1010 IF GA<-.35 THEN GA:=-.35
1020 //MISSILE-TARGET KINEMATICS
1030 XM:=XM+VM*COS(GAMM)*DT
1040 ZM:=ZM-VM*SIN(GAMM)*DT
1050 GAMM:=GAMM+GAMTD*DT
1060 XT:=XT+VT*COS(GAMT)*DT
1070 ZT:=ZT-VT*SIN(GAMT)*DT
1080 DELX:=XT-XM
1090 DELZ:=ZM-ZT
1100 SIGT:=ATN(DELZ/DELX)
1110 IF DELX<0 THEN SIGT:=SIGT+PIE
1120 R:=SQR(DELX*DELX+DELZ*DELZ)
1130 T:=T+DT
1140 //ITERATIVE LOGIC AND PRINTOUTS
1150 IF R<=30 THEN ENDOUT
1160 IF T>(T2-DT) THEN PRINTOUT
1170 IF T>=5 THEN END
1180 UNTIL R<=30
1190 PROC PRINTOUT
1200 A:=VM*SIN(GAMM-SIGT)-VT*SIN(GAMT-SIGT)
1210 B:=VM*COS(GAMM-SIGT)-VT*COS(GAMT-SIGT)
1220 DELT:=R/B
1230 ZD:=A*DELT
1240 PRINT TAB(1),INT(T*100)/100;TAB(6),INT(VM);TAB(12),INT(DELX);
1250 PRINT TAB(18),INT(DELZ);TAB(24),INT(SIGR*1000)/1000;
1260 PRINT TAB(30),INT(GAMM*1000)/1000;TAB(36),INT(THM*1000)/1000;
1270 PRINT TAB(42),INT(AL*1000)/1000;TAB(49),INT(GA*1000)/1000;
1275 PRINT TAB(56),INT(DELS*1000)/1000;
1280 PRINT TAB(63),INT(ANM*100)/100;TAB(70),INT(ZD*100)/100
1290 T2:=T2+.1
1300 ENDPROC PRINTOUT
1310 PROC ENDOUT
1320 PRINTOUT
1325 POKE 53265,27 // TURN SCREEN ON
1330 PRINT
1340 PRINT "ZD= ",INT(ZD*1000)/1000;" DELT= ",INT(DELT*1000)/1000
1350 SELECT OUTPUT "DS:"
1360 PRINT " DONE"
1370 END
1380 ENDPROC ENDOUT
1390 PROC SAMPLEDATA
1400 T4:=T4+T3
1410 E2P:=EP
1420 SIGRD:=AKR*AKT*E2P
1430 IF SIGRD>=.35 THEN SIGRD:=.35
1440 IF SIGRD<-.35 THEN SIGRD:=-.35
1450 ENDPROC SAMPLEDATA